/*
 * @Author: ૮₍ ˙О˙₎ა
 * @Date: 2023-05-30 09:38:48
 * @description: 医院设置api
 */
import {request} from '@/utils/http'
import { ReqAddHospitalSet, ReqHospitalItem, ReqHospitalSetListResponse, ReqHospitalSetParams, ReqUpdateHospitalSet } from './model/hospitalSetTypes';
import React from 'react';

/**
 * @description: 请求获取医院列表api
 * @return {*} Promise<ReqHospitalSetListResponse>
 * @param {ReqHospitalSetParams} param1
 */
export function ReqGetHospitalList({page,limit,hosname,hoscode}:ReqHospitalSetParams){
    
    return request.get<any,ReqHospitalSetListResponse>(`/admin/hosp/hospitalSet/${page}/${limit}`,{
        params:{
            hosname,
            hoscode
        }
    });
}

/**
 * @description: 添加医院设置api
 * @return {*} null
 * @param {ReqAddHospitalSet} hospital
 */
export function AddSaveHospital(hospital:ReqAddHospitalSet){
    return request.post('/admin/hosp/hospitalSet/save',hospital);
}

/**
 * @description: 回显医院设置api
 * @return {*} Promise<ReqHospitalItem>
 * @param {string} id
 */
export function ReqGetHospitalItem(id:string){
    return request.get<any,ReqHospitalItem>(`/admin/hosp/hospitalSet/get/${id}`);
}

/**
 * @description: 修改医院设置api
 * @return {*} null
 * @param {ReqUpdateHospitalSet} hospital
 */
export function ReqUpdateHospitalSetResponse(hospital:ReqUpdateHospitalSet){
    return request.put<any,null>(`/admin/hosp/hospitalSet/update`,hospital);
}

/**
 * @description: 删除医院设置api
 * @return {*} null
 * @param {string} id
 */
export function ReqDeleteHospitalSetItem(id:string){
    return request.delete<any,null>(`/admin/hosp/hospitalSet/remove/${id}`);
}

/**
 * @description: 批量删除医院设置api
 * @return {*} null
 * @param {React.Key[]} idList[]
 */
export function ReqBatchDeleteHospitalSetItem(idList:React.Key[]){
    return request.delete<any,null>(`/admin/hosp/hospitalSet/batchRemove`,{
        data:idList
    });
}